<div id="control">
	<a href="{Url::anchor("admin/{Input::get(1)}")}" class="item small text"><img src="/styles/admin/gfx/icons/small/cancel.png" alt="Đóng"/><span>Đóng</span></a>
</div>

<div class="section">
	<div class="box">
		<div class="title">
			Form
			<span class="hide"></span>
		</div>
		<div class="content">
			<form action="{Url::current()}" method="post">
				<div class="row">
					<label>Tên *</label>
					<div class="right"><input type="text" name="name" value="{if isset($category)}{$category.name}{/if}" maxlength="50" placeholder="Max. 50 characters..." /></div>
				</div>
				<div class="row">
					<label>Keywords</label>
					<div class="right"><input type="text" name="keywords" value="{if isset($category)}{$category.keywords}{/if}"/></div>
				</div>
				<div class="row">
					<label>Description</label>
					<div class="right"><input type="text" name="description" value="{if isset($category)}{$category.description}{/if}"/></div>
				</div>
                <div class="row">
					<label>Cây danh mục</label>
					<div class="right">
						<select name="parent_id" class="big">				
							<option value="0">Danh mục gốc</option>
							{foreach $categories as $row}
							<option value="{$row.id}" {if isset($category.parent_id) && $row.id eq $category.parent_id} selected=""{/if} >{$row.name}</option>
							{/foreach}
						</select>
					</div>
				</div>   
                <div class="row">
					<label>Sắp xếp: </label>
					<div class="right"><input type="text" name="txtSort" value="{if isset($category.sort)}{$category.sort}{/if}" /></div>
				</div>
                <div class="row">
					<label>Tình trạng</label>
					<div class="right">
						<select name="status">
                            <option value="1" {if isset($category.status)&& $category.status eq 1} selected="" {/if}>Bật</option>
							<option value="0" {if isset($category.status)&& $category.status eq 0} selected="" {/if}>Tắt</option>										
						</select>
					</div>
				</div>
                <div class="row">
					<div class="right">
                        <input type="hidden" name="token" value="{Security::setToken('category_form')}" />
						<input type="hidden" name="action" value="{$action}" />
						<button type="submit"><span>Save</span></button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>